{% extends "base_generic.html" %}
{% load i18n %}

{% block title %}<title>{% translate 'My Favorites' %} - {{ block.super }}</title>{% endblock %}

{% block content %}
<div class="container mt-4">
  <h1 class="mb-4">{% translate 'My Favorite Books' %}</h1>

  {% if book_list %}
    <ul class="list-group shadow-sm">
      {% for book in book_list %}
        <li class="list-group-item d-flex justify-content-between align-items-center">
          <a href="{{ book.get_absolute_url }}" class="text-decoration-none">{{ book.title }}</a>
          <span class="text-muted">by {{ book.author }}</span>
        </li>
      {% endfor %}
    </ul>
  {% else %}
    <div class="alert alert-info" role="alert">
      <p>{% translate "You haven't favorited any books yet." %}</p>
      <p><a href="{% url 'books' %}" class="alert-link">{% translate 'Explore books' %}</a> {% translate 'and find your next favorite!' %}</p>
    </div>
  {% endif %}
</div>
{% endblock %}
